package com.gg.mapper;

import com.gg.entity.Course;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CourseMapper {
    //查全部
    @Select("select * from course where id=#{id};")
    @Results({
            @Result(column = "teacher_id", property = "teacherId"),
            @Result(column = "teacher_id", property = "teacher", one = @One(select = "com.gg.mapper.TeacherMapper.selectAllTeacher"))
    })
    List<Course> selectAllCourse(int id);
}
